/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package cn.ac.iie.di.parser.mp.utils;

import LangTools.LangIdentifyTool;
import java.text.SimpleDateFormat;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Administrator
 */
public class Test {

    public static void main(String[] args) {
        
        try {
            String json="{\"record_meta\":[{\"name\":\"content_id\",\"type\":\"string\"},{\"name\":\"parent_id\",\"type\":\"string\"},{\"name\":\"article_url\",\"type\":\"string\"},{\"name\":\"content_type\",\"type\":\"string\"},{\"name\":\"author_id\",\"type\":\"string\"},{\"name\":\"from\",\"type\":\"string\"},{\"name\":\"author_name\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"text_length\",\"type\":\"int\"},{\"name\":\"image_num\",\"type\":\"int\"},{\"name\":\"video_num\",\"type\":\"int\"},{\"name\":\"create_time\",\"type\":\"string\"},{\"name\":\"snapshot_time\",\"type\":\"string\"},{\"name\":\"modify_time\",\"type\":\"string\"},{\"name\":\"abstract\",\"type\":\"string\"},{\"name\":\"post_type\",\"type\":\"strings\"},{\"name\":\"is_del\",\"type\":\"string\"},{\"name\":\"content\",\"type\":\"string\"},{\"name\":\"classes\",\"type\":\"strings\"},{\"name\":\"del_time\",\"type\":\"string\"},{\"name\":\"like_num\",\"type\":\"long\"},{\"name\":\"view_num\",\"type\":\"long\"},{\"name\":\"comment_num\",\"type\":\"long\"}],\"total_pushed_num\":\"1\",\"pushed_time\":\"2017-11-24 19:17:14\",\"record_list\":[{\"snapshot_time\":\"2017-11-24 17:01:25\",\"classes\":[],\"abstract\":\"\",\"text_length\":14,\"video_num\":0,\"view_num\":0,\"from\":\"MP\",\"article_url\":\"https://www.meipian.cn/xijs8by\",\"content\":{\"text\":\"又见新作，越来越好，，点赞👍\"},\"image_num\":0,\"title\":\"人生苦短！且行且珍惜！\",\"content_id\":\"41296717\",\"del_time\":\"\",\"author_name\":\"单骑愚公\",\"create_time\":\"2017-11-24 14:48:24\",\"comment_num\":0,\"is_del\":\"1\",\"post_type\":[],\"like_num\":0,\"author_id\":\"9705816\",\"modify_time\":\"2017-11-24 14:48:24\",\"content_type\":\"comment\",\"parent_id\":\"72955438\"}],\"task_id\":\"412967171511522234\",\"src_id\":\"4\"}";
            List<Map<String, String>> datamap = ParserJson.getContentByRecord_list(json);
            for (Map<String, String> datamap1 : datamap) {
                for (Map.Entry<String, String> entrySet : datamap1.entrySet()) {
                    String key = entrySet.getKey();
                    String value = entrySet.getValue();
                    System.out.println("key =" + key + ",value = " + value);
                    LangIdentifyTool langtool = new LangIdentifyTool();
                    langtool.initText(datamap1.get("text").toString());
                    String langType = langtool.getLangType();
                    System.out.println(langType);
                }

            }

        } catch (Exception ex) {
            Logger.getLogger(Test.class.getName()).log(Level.SEVERE, null, ex);
        }
        try {
        } catch (Exception e) {
        }
    }
}
